package com.topvision.idcard;

import android.content.Context;
import android.util.DisplayMetrics;
import android.view.WindowManager;

/**
 * 手勢工具類
* @ClassName: GestureUtils 
* @Description:封装了一些触控上所需要使用的方法
* @author gushenjie
* @date 2016-7-6 上午9:49:20 
*
 */
public class GestureUtils {
	 
    /**
     * 
     * @param context
     * @return
     */
    public static Screen getScreenPix(Context context) {
        DisplayMetrics dm = new DisplayMetrics();
        WindowManager windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
        windowManager.getDefaultDisplay().getMetrics(dm);
        return new Screen(dm.widthPixels,dm.heightPixels);
    }
   
    public static class Screen{
       
        public int widthPixels;
        public int heightPixels;
       
        public Screen(){
           
        }
       
        public Screen(int widthPixels,int heightPixels){
            this.widthPixels=widthPixels;
            this.heightPixels=heightPixels;
        }
        @Override
        public String toString() {
            return "("+widthPixels+","+heightPixels+")";
        }
       
    }
   
}